<template>
  <div>
    <div class="New_Footer">
      <div class="New_Footer_top">
        <div class="New_Footer_top_left">
          <div>
            <div>产品与服务</div>
            <div>
              <!-- <router-link :to="{name:'xiaochengxu'}">解决方案</router-link> -->
            </div>
            <div>
              <!-- <router-link :to="{name:'guanggao'}">中天广告</router-link> -->
            </div>
          </div>
          <div>
            <div>关于公司</div>
            <div>
              <!-- <router-link :to="{name:'jituan'}">中天简介</router-link> -->
            </div>
            <div>
              <!-- <router-link :to="{name:'guanyu1'}">团队风采</router-link> -->
            </div>
            <div>
              <!-- <router-link :to="{name:'guanyu2'}">联系我们</router-link> -->
            </div>
          </div>
          <div>
            <div>关注我们</div>
            <div style="cursor:pointer;" @click="NewFooter">官方微信</div>
          </div>
        </div>
        <div class="New_Footer_top_right">
          <div>
            <div class="New_Footer_top_tel">联系电话</div>
            <div class="New_Footer_top_phone">400-0385-581</div>
            <div class="New_Footer_top_email">官方邮箱：297216464@qq.com</div>
            <!-- <div class="New_Footer_top_address"
            style="margin-bottom:20px;">地址：七台河市桃山区万宝小区5号商服</div>-->
            <div class="New_Footer_top_address">
              <div>
                友情链接：
                <a href="http://www.zhiyunzaixian.com" target="_blank"
                  >知运在线教育平台</a
                >
              </div>
            </div>
          </div>
          <div>
            <img
              src="http://o6wndwjxn.qnssl.com/5f99c201810121521135293.png"
              alt="img"
            />
          </div>
        </div>
      </div>
      <div class="New_Footer_fot">
        <!-- 杭州忠讯科技有限公司-ICP备案：黑ICP备14006444号-2 -->
      </div>

      <!-- 弹出的二维码 -->
      <div
        class="New_footer_code"
        :style="'transform: scale(' + NewFooterCode + ');'"
      >
        <div class="New_footer_code_close" @click="NewFooterClose">X</div>
        <div>
          <img
            src="http://o6wndwjxn.qnssl.com/5df9f201809101359358127.jpg"
            alt
          />
        </div>
      </div>
    </div>
    <!--
    <form @submit.prevent="NewUser()">
      <div class="New_index_bottom"
           :style="'bottom:'+NewBottom+'px;'">
        <div class="New_index_Close"
             @click="NewClose()">
          <img src="http://o6wndwjxn.qnssl.com/2f8e5201809101129233402.png"
               :style="'transform: rotate('+ NewImgRotate +');'"
               alt="">
        </div>
        <div>

          <div class="chaxun"
               style="height: 300px">
            <div
             class="New_index_nav_one"
            >中天站长真伪查询</div>
            <div class="New_input">
              <input placeholder="输入站长微信号查询真伪（谨防被骗）"
                     v-model="input1">
              <button @click="dianji()">查询</button>
            </div>
          </div>
        </div>
      </div>
    </form>-->

    <div
      :style="'bottom:' + NewTop + 'px;'"
      class="New_index_toTop"
      @click="NewtoTop"
    >
      <img src="http://o6wndwjxn.qnssl.com/969f2201809081017507440.png" alt />
    </div>
    <!-- <div class="New_index_input_success" :style="'top:'+ Newsuccesstop +'%; opacity:'+ Newsuccessopa +';'">提交成功</div> -->
  </div>
</template>

<script>
import axios from "axios";
export default {
  name: "Footer",
  props: {
    equipments: {
      type: String,
      default: "pc"
    }
  },
  data() {
    return {
      input1: "",
      NewFooterCode: 0,
      NewImgRotate: "180deg",
      NewFootersuccess: false,
      Newsuccess: true,
      Newsuccesstop: -10,
      Newsuccessopa: 0,
      Newuser: {
        name: "",
        city: "",
        phone: ""
      },
      NewBottom: 0,
      NewTop: 250
    };
  },
  mounted() {
    this.NewTopShow();
    window.addEventListener("scroll", this.NewTopShow);
  },
  methods: {
    dianji() {
      if (this.input1 !== "") {
        let a = new FormData();
        a.append("wx", this.input1);
        axios
          .post("http://infoapi.ztwlxx.net/index/index/isMaster", a)
          .then(res => {
            if (res.data.code === 200) {
              this.$msgbox({
                message: res.data.data,
                type: "success"
              });
              this.input1 = "";
            } else {
              this.$msgbox({
                message: res.data.msg,
                type: "warning"
              });
              this.input1 = "";
            }
          });
      } else {
        this.$msgbox({
          message: "输入不能为空",
          type: "warning"
        });
      }
    },
    NewFooter() {
      this.NewFooterCode = 1;
    },
    NewFooterClose() {
      this.NewFooterCode = 0;
    },
    NewClose() {
      // var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
      if (this.NewBottom === 0) {
        this.NewTop = 50;
        this.NewBottom = -200;
        this.NewImgRotate = "0deg";
      } else {
        this.NewTop = 250;
        this.NewBottom = 0;
        this.NewImgRotate = "180deg";
      }
    },
    NewUser() {
      this.NewFootersuccess = true;
      this.Newsuccess = true;
      var FormData = JSON.stringify(this.Newuser);
      axios.post("http://47.96.248.251:8001/", FormData).then(res => {
        if (res.data.code === 200) {
          this.Newuser.name = "";
          this.Newuser.city = "";
          this.Newuser.phone = "";
          let number = 0;
          var successtime = setInterval(function() {
            number++;
            if (number < 20) {
              this.Newsuccesstop = 20;
              this.Newsuccessopa = 1;
            } else {
              clearInterval(successtime);
              this.Newsuccesstop = -10;
              this.Newsuccessopa = 0;
            }
          }, 100);
        }
      });
    },
    NewTopShow() {
      // var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop || 0
      if (this.NewBottom === 0) {
        this.NewTop = 250;
      } else {
        this.NewTop = 50;
      }
    },
    NewtoTop() {
      let scrollTop =
        window.pageYOffset ||
        document.documentElement.scrollTop ||
        document.body.scrollTop ||
        0;
      let time = setInterval(function() {
        if (scrollTop > 600) {
          scrollTop -= 100;
          window.pageYOffset = document.documentElement.scrollTop = document.body.scrollTop = scrollTop;
        } else {
          clearInterval(time);
          window.pageYOffset = document.documentElement.scrollTop =
            document.body.scrollTop;
        }
      }, 5);
    },
    Newsuccessc() {
      this.NewFootersuccess = false;
    }
  }
};
</script>
<style lang="css" src="../../../assets/scss/website/Footer.css" scoped></style>
